<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>综合实践项目管理系统</title>
    <!-- Bootstrap core CSS -->
    <link href="../static/asserts/css/bootstrap.min.css" th:href="@{../static/asserts/css/bootstrap.min.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="../static/asserts/css/dashboard.css" th:href="@{../static/asserts/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<!--引入抽取的顶部文件-->
<div th:replace="commons/common :: top"></div>

<div class="container-fluid">
    <div class="row">
        <!--引入侧边栏-->
        <div th:replace="commons/common::#left"></div>
        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <h2>实训项目管理</h2>

            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <thead>
                    <tr>
                        <th></th>
                        <th>项目编号</th>
                        <th>项目名</th>
                        <th>公司名</th>
                        <th>报名费用</th>
                        <th>操作</th>
                        <th>项目状态</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="poj:${pojs}">
                        <td><input type="checkbox"></td>
                        <td th:text="${poj.id}" style="display: none"></td>
                        <td th:text="${poj.pcode}"></td>
                        <td th:text="${poj.pname}"></td>
                        <td th:text="${poj.companyname}"></td>
                        <td th:text="'￥' +${poj.cost}"></td>
                        <td>
                            <a class="btn btn-sm " th:href="@{/admin/}+${poj.id}">项目详情</a>
                        </td>
                        <td th:text="待审批" type="button" th:onclick="sp([[${poj.id}]],[[${poj.companyname}]],[[${poj.pname}]]);" style="display: none" th:style="${poj.pattr1} == '0' ? 'display:show':'display:none'"></td>
                        <td th:text="审批通过"  style="display: none" th:style="${poj.pattr1} == '1' ? 'display:show':'display:none'"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </main>
    </div>
</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <form th:action="@{/adminSpPoj}" method="post">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel">
                        实训项目审批
                    </h4>
                </div>

                <div class="modal-body">
                    <input type="hidden" id="pojid" name="pojid" value="">
                    企业名:<input id="comname" name="comname" type="text"  readonly><br>
                    项目名:<input id="pname" name="pname" type="text" readonly>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary">
                        批准通过
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </form>
    </div><!-- /.modal -->
</div>


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="../static/login/js/jquery-3.4.1.min.js" th:src="@{../static/login/js/jquery-3.4.1.min.js}"></script>
<script type="text/javascript" src="../static/asserts/js/popper.min.js" th:href="@{../static/asserts/js/popper.min.js}"></script>
<script type="text/javascript" src="../static/asserts/js/bootstrap.min.js" th:href="@{../static/asserts/js/bootstrap.min.js}"></script>

<!-- Icons -->
<script type="text/javascript" src="../static/asserts/js/feather.min.js" th:href="@{../static/asserts/js/feather.min.js}"></script>
<script>
    feather.replace()
</script>

<!-- Graphs -->
<script type="text/javascript" src="../static/asserts/js/Chart.min.js" th:href="@{../static/asserts/js/Chart.min.js}"></script>
<script>
    var ctx = document.getElementById("myChart");
    var myChart = new Chart(ctx, {
        type: 'line',
        data: {
            labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            datasets: [{
                data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
                lineTension: 0,
                backgroundColor: 'transparent',
                borderColor: '#007bff',
                borderWidth: 4,
                pointBackgroundColor: '#007bff'
            }]
        },
        options: {
            scales: {
                yAxes: [{
                    ticks: {
                        beginAtZero: false
                    }
                }]
            },
            legend: {
                display: false,
            }
        }
    });
</script>
<script>
    function sp(pojid,companyname,pname){
        document.getElementById("pojid").value = pojid;
        document.getElementById("comname").value = companyname;
        document.getElementById("pname").value = pname;
        $('#myModal').modal('show');
    }
</script>
</body>
</html>